package com.yxc.easyexceldemo.const_enum;

/**
 * @author: YXC
 * @time: 2022/11/15 11:24
 **/
public enum SexEnum implements MEnum<SexEnum, Integer> {

    /**
     * 男
     */
    MAN("男", 0),
    /**
     * 女
     */
    WO_MAN("女", 1),
    /**
     * 全部，未知
     */
    DEFAULT("未知", -999);

    private String name;

    private Integer code;

    SexEnum(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public static void main(String[] args) {
        SexEnum byCode = SexEnum.DEFAULT.getByCode(1);
        System.out.println(byCode);
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String toString() {
        return this.name;
    }
}
